<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>总客服</title>
    <link rel="stylesheet" href="${base}/layui/css/layui.css">
    <link rel="stylesheet" href="${base}/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${base}/css/admin.css">
    <link rel="stylesheet" href="${base}/layui/css/layim.css">
    <style>
    	.layui-bg-black{width: 200px;height: 136px;margin-right: 30px;float: left;text-align: center;font-size: 33px;color: #000000!important;padding-top: 30px;}
    	.hide {display: none;}
    	.checkbox{display: inline-block;}
    	.layui-form-item{font-size: 18px;}
    	.width100 {width: 100px;}
    	.discuss{ float: left;margin-left: 30px;padding-top: 6px;}
    	.discuss p{text-align: left; font-size: 13px;margin-top: 5px;padding-top: 2px;}
    	.discuss_img{ float: left;margin-left: 10px;margin-top: 5px;}
     	.img {vertical-align: top;} 
     	    
    </style>
</head>
<body  class="layui-layout-body" style="overflow:scroll;">
<#include "/common/left.flt">	
<div class="layui-main" style="position: absolute;left: 205px;top: 60px; width: calc(100% - 210px);" >
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
  <legend>总客服-所有水号聊天回复</legend>
</fieldset>
<blockquote class="layui-elem-quote layui-quote-nm">
 	<form action="${base}/chat/index" method="post" id="dataForm">
		<div class="layui-input-inline">
 		<label class="layui-form-label">地区负责人</label><select name="person" id="person" class="width100 layui-select">
 				<option value=""></option>
 				<option value="1">袁杰</option>
                <option value="2">李扬</option>
                <option value="3">张炜</option>
                <option value="4">常少彪</option>
                <option value="100">强制清空</option>
		      </select>
		      <button class="layui-btn" lay-submit=""> <span class="fa fa-search"></span> 查询</button>
		      
		      <a class="layui-btn" id="remove1"  >删除好友</a>
		      <a class="layui-btn" id="close1"  >关闭</a>
		      <a class="layui-btn" id="send1"  >发送</a>
				
    	</div>
    </form>
</blockquote> 

<div class="layui-layer layui-layer-page layui-box layui-layim-chat" id="layui-layer2" contype="string" style="z-index: 19891016; width: 880px; top: 240px; left: 262px; ">
<div class="layim-chat-box">
	<div class="layim-chat layim-chat-friend layui-show">
		<div class="layui-unselect layim-chat-title">
			<div class="layim-chat-other">
			
				<a href="${base}/users_list/detail?user_id=${receive.id}" target="_blank" ><img class="layim-friend100001" src="http://qiniu.static.50dufei.top/${receive.userHeader?default('')}?imageView2/1/w/100/h/100"  title="我"/></a>
				<span class="layim-chat-username" layim-event=""><script>document.write(decodeURIComponent("${receive.nickName}"));</script>  ${receive.userMobile?default('')}  </span>
				<p class="layim-chat-status">user_id:${receive.id}</p>
			</div>
			<div style="display: inline-block;width: 540px;position: fixed;top: 240px;right: -180px;">
				<p>他的好友列表 : ${detail?default('')} </p>
				<table class="layui-table" style="display: inline-block;width: auto;" >
				<thead>
			       <tr>
		              <th>id</th>
		              <th>昵称</th>
		              <th>地区</th>
		              <th>hello</th>
		          </tr>
			     </thead>
			     <tbody>
			     <#list friends as f>
			     <tr>
				    <td><a href="${base}/users_list/detail?user_id=${f.user_id}" target="_blank" >${f.user_id}</a></td>
			     	<td>${f.nick_name?default('')}</td>
			     	<td>${f.area?default('')} </td>
			     	<td>${f.content?default('')} </td>
			     </tr>
				 </#list>
				 
			     </tbody>
			</table>
			</div>
		</div>
	<div class="layim-chat-main" style="height: 262px;">
		<ul>
		<#list list as m>
			<li>
				<div class="layim-chat-user">
				<#if m.fromUserId?eval == send.id>
				<a href="${base}/users_list/detail?user_id=${send.id}" target="_blank" ><img src="http://qiniu.static.50dufei.top/${send.userHeader?default('')}?imageView2/1/w/100/h/100"></a><cite><script>document.write(decodeURIComponent("${send.nickName}"));</script>(会员到期时间${viptime})  送过${hot} <i>${m.create_time_string}</i></cite>
				<#else>
				<a href="${base}/users_list/detail?user_id=${receive.id}" target="_blank" ><img src="http://qiniu.static.50dufei.top/${receive.userHeader?default('')}?imageView2/1/w/100/h/100"></a><cite><script>document.write(decodeURIComponent("${receive.nickName}"));</script></cite>
				</#if>
				</div>
				<div class="layim-chat-text">${m.content}</div>
			</li>
		</#list>
		</ul>
	</div>
	<div class="layim-chat-footer">
		<div class="layim-chat-textarea">
			<textarea id="content" name="content" placeholder="说点什么"></textarea>
		</div>
		<div class="layim-chat-bottom">
			<div class="layim-chat-send">
				<span class="layim-send-btn" id="remove" >删除好友</span>
				<span class="layim-send-btn" id="close" >关闭</span>
				<span class="layim-send-btn" id="send" >发送</span>
			</div>
		</div>
	</div>
</div>
</div>
</div>
<form action="${base}/util/uploadFile" method="post" name="uploadForm" enctype="multipart/form-data" id="uploadForm" class="hide" >
    <input name="pic" type="file" id="pic" class="hide"/>
</form>
</body>
<script src="${base}/js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="${base}/js/jquery.form.js"></script>
<script src="${base}/layui/layui.all.js"></script>
<script type="text/javascript">
$("#person").val('${person?default('')}');
$('#content').bind('keyup', function(event) {
　　if (event.keyCode == "17") {
　　　　//回车执行查询
　　　　$('#send').click();
　　}
});


$("#remove1").click(function (){
	$("#remove").click();
});
$("#remove").click(function (){
	$.post("${base}/chat/remove",
	   		{"id":${one.id}},function(data){ 
	   			layer.alert(data);
	   			window.location.reload();
	   		}
	 );	
});
$("#send1").click(function (){
	$("#send").click();
});
$("#send").click(function (){
	var content = $("#content").val();
	$.post("${base}/chat/reply",
	   		{"id":${one.id},"content":content},function(data){ 
	   			layer.alert(data);
	   			window.location.reload();
	   		}
	 );	
});
$("#close1").click(function (){
	$("#close").click();
});
$("#close").click(function (){
	$.post("${base}/chat/pass",
	   		{"id":${one.id}},function(data){ 
	   			layer.alert(data);
	   			window.location.reload();
	   		}
	 );			
});

</script>
</html>